<template>
  <div class="container">
    <div class="attractions">
      <div class="title">
        <h1>酒店</h1>
        <el-row>
          <el-button><i class="el-icon-location-outline"></i>地图</el-button>
          <el-button>旅行者排名</el-button>

          <el-popover
            placement="top-start"
            title="旅行者排名"
            width="200"
            trigger="hover"
            content="Tripadvisor评分最高的景点,根据旅行者评分计算得出."
          >
            <i slot="reference" class="el-icon-info"></i>
          </el-popover>
        </el-row>

        <el-divider></el-divider>
      </div>

      <div class="type">
        <div class="tleft">
          <el-row class="tac">
            <el-col :span="3">
              <h5>类型</h5>
              <el-menu class="el-menu-vertical-demo">
                <el-menu-item>
                  <span slot="title">自然与公园</span>
                </el-menu-item>
                <el-menu-item>
                  <span slot="title">景点与地标</span>
                </el-menu-item>
                <el-menu-item>
                  <span slot="title">博物馆</span>
                </el-menu-item>
                <el-menu-item>
                  <span slot="title">夜生活</span>
                </el-menu-item>
                <el-submenu>
                  <template slot="title">
                    <span style="color: #7446af; font-weight: bold"
                      >显示更多</span
                    >
                  </template>
                  <el-menu-item>动物园与水族馆</el-menu-item>
                  <el-menu-item>跟团游览</el-menu-item>
                </el-submenu>
              </el-menu>

              <el-menu class="el-menu-vertical-demo" :default-openeds="['1']">
                <el-submenu index="1">
                  <template slot="title">
                    <span style="font-size: 20px; font-weight: bold"
                      >景点类型</span
                    >
                  </template>
                  <el-menu-item>
                    <el-checkbox v-model="checked">公园</el-checkbox>
                  </el-menu-item>
                  <el-menu-item>
                    <el-checkbox v-model="checked">水域</el-checkbox>
                  </el-menu-item>
                  <el-menu-item>
                    <el-checkbox v-model="checked">海滩</el-checkbox>
                  </el-menu-item>
                  <el-menu-item style="margin-top: 20px">
                    <span style="color: #7446af; font-weight: bold" slot="title"
                      >显示所有</span
                    >
                  </el-menu-item>
                </el-submenu>
              </el-menu>

              <el-menu class="el-menu-vertical-demo" :default-openeds="['1']">
                <el-submenu index="1">
                  <template slot="title">
                    <span style="font-size: 20px; font-weight: bold"
                      >旅行者评分</span
                    >
                  </template>
                  <el-menu-item>
                    <el-checkbox v-model="checked">
                      <div class="pff">
                        <div></div>
                        <div></div>
                        <div></div>
                        <div></div>
                        <div></div>
                        <span>5星</span>
                      </div>
                    </el-checkbox>
                  </el-menu-item>
                  <el-menu-item>
                    <el-checkbox v-model="checked">
                      <div class="pff">
                        <div></div>
                        <div></div>
                        <div></div>
                        <div></div>
                        <div style="background-color: white"></div>
                        <span>4星以上</span>
                      </div>
                    </el-checkbox>
                  </el-menu-item>
                  <el-menu-item>
                    <el-checkbox v-model="checked">
                      <div class="pff">
                        <div></div>
                        <div></div>
                        <div></div>
                        <div style="background-color: white"></div>
                        <div style="background-color: white"></div>
                        <span>3星以上</span>
                      </div>
                    </el-checkbox>
                  </el-menu-item>
                  <el-menu-item>
                    <el-checkbox v-model="checked">
                      <div class="pff">
                        <div></div>
                        <div></div>
                        <div style="background-color: white"></div>
                        <div style="background-color: white"></div>
                        <div style="background-color: white"></div>
                        <span>2星以上</span>
                      </div>
                    </el-checkbox>
                  </el-menu-item>
                </el-submenu>
              </el-menu>

              <el-menu class="el-menu-vertical-demo" :default-openeds="['1']">
                <el-submenu index="1">
                  <template slot="title">
                    <span style="font-size: 20px; font-weight: bold">奖项</span>
                  </template>
                  <el-menu-item>
                    <span>旅行者之选至尊奖</span>
                  </el-menu-item>
                  <el-menu-item>
                    <span>旅行者之选</span>
                  </el-menu-item>
                </el-submenu>
              </el-menu>

              <el-menu class="el-menu-vertical-demo" :default-openeds="['1']">
                <el-submenu index="1">
                  <template slot="title">
                    <span style="font-size: 20px; font-weight: bold">区域</span>
                  </template>
                  <el-menu-item style="margin-top: 20px">
                    <span style="color: #7446af; font-weight: bold" slot="title"
                      >显示所有</span
                    >
                  </el-menu-item>
                </el-submenu>
              </el-menu>
            </el-col>
          </el-row>
        </div>

        <div class="tright">
          <p>
            按旅行者排名排序的897个地点<el-popover
              placement="top-start"
              width="200"
              trigger="hover"
              content="Tripadvisor评分最高的景点,根据旅行者评分计算得出."
            >
              <i slot="reference" class="el-icon-info"></i>
            </el-popover>
          </p>
          <div class="xq">
            <div
              class="xq1"
              v-for="{ hid, title, pic, city } in data.data"
              :key="hid"
            >
              <img :src="`img/${pic}`" alt="" />
              <div class="js">
                <h2 style="margin-bottom: 10px">{{ hid }}.{{ city }}</h2>
                <p>{{ title }}</p>
              </div>
              <div class="pj">
                <template>
                  <div class="demo-type">
                    <div>
                      <el-avatar
                        src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
                      >
                      </el-avatar
                      ><span>By Tripadvisor用户</span>
                    </div>
                  </div>
                </template>
                <p>
                  Enjoyed the cold at the Bund on New Year’s eve. No firework...
                </p>
              </div>
            </div>
          </div>
          <div class="fy">
            <el-pagination background layout="prev, pager, next" :total="1000">
            </el-pagination>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: [],
    };
  },
  mounted() {
    // 获取景点
    this.axios.get("hotellist").then(res => {
      console.log(res);
      this.data = res.data;
      console.log(this.data);
    });
  },
};
</script>

<style lang="scss" scoped>
.container {
  width: 100%;
  background-color: #f2f2f2;
}
.attractions {
  width: 1280px;
  margin: 0 auto;
  .title {
    h1 {
      font-size: 50px;
    }

    .el-row {
      height: 40px;

      .el-popover__reference-wrapper {
        --swiper-navigation-size: 10px;

        .el-button {
          border: none;
        }
      }

      .el-icon-info {
        position: relative;
        top: -10px;
        margin-left: 10px;
      }

      .el-button {
        border-radius: 20px;
        font-size: 16px;

        .el-icon-location-outline {
          padding-right: 6px;
          font-weight: bold;
        }
      }
    }
  }

  .type {
    display: flex;
    justify-content: center;

    .tleft {
      width: 280px;
      margin: 0 40px 30px;
      background-color: white;
      height: 800px;

      .el-menu {
        border: none;

        .pff {
          div {
            float: left;
            margin-right: 2px;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: green;
            border: 2px solid green;
          }

          :last-child {
            background-color: white;
          }

          span {
            margin-left: 2px;
          }
        }

        .el-menu-item {
          height: 30px;
          line-height: 30px;

          &:hover,
          &:focus {
            background-color: white !important;
            color: black;
            font-weight: bold;
            text-decoration: underline;
          }
        }
      }
    }

    .tright {
      width: 900px;

      .xq {
        .xq1 {
          background-color: white;
          border: 2px solid #e5e5e5;
          margin-top: 20px;
          height: 208px;
          &:hover {
            box-shadow: 0px 0px 3px 1px #e4e4e4;
          }
          img {
            width: 240px;
            height: 208px;
            float: left;
            margin-right: 30px;
          }

          .js {
            width: 300px;
            padding: 10px;
            float: left;
          }

          .pj {
            width: 300px;

            float: left;
            padding-top: 60px;
            box-sizing: border-box;

            .demo-type {
              p {
                height: 40px;
                line-height: 40px;
              }
            }
          }
        }
      }
      .fy {
        text-align: center;
        margin-top: 50px;
      }
    }
  }
}
</style>
